package com.ssmdemo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ssmdemo.entity.TypeCategory;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TypeCategoryMapper extends BaseMapper<TypeCategory> {

    @Select("select id,type_name typeName from type_category")
    List<TypeCategory> queryCategory();

    @Insert("insert into type_category(type_name) value(#{typeName}))")
    public int insert(@Param("typeName") String typeName);

    @Delete("delete from type_category where id=#{id}")
    public int delete(@Param("id") Integer id);

}
